package com.lovegu.other;

import java.util.stream.Stream;

/**
 * @author 老顾
 * @title: StreamTest
 * @projectName java-restudy
 * @email: 1437594522@qq.com
 * @date 2022/9/26 17:16
 */
public class StreamTest {

    public static void main(String[] args) {
        Stream<Integer> stream = Stream.iterate(0,x->x+2);
        stream.limit(10).forEach(System.out::println);
        Stream<Double> stream1 = Stream.generate(Math::random);
        stream1.limit(10).forEach(System.out::println);
    }
}
